///@file PerfTests.cpp
///@brief Implementation of the test procedures for performance
///@author Arnaud Duval
///@version 0.0
///@date 2010/03/19

#include <iostream>
#include <ctime>

#include "PerfTests.h"
#include "../../mathobject/include/Matrix.h"


///@brief Performance test for matrix operators
///@param n Maximum size of matrix to test
void TestMatrix(unsigned int n)
{
	for(unsigned int i = 1 ; i <= n ; i*=2)
	{
		std::cout << i << "\t";
		Matrix a(i,'r');
		time_t t1, t2;

		time(&t1);
		a.Invert();
		time(&t2);
		std::cout << difftime(t2,t1) << "\t";

		Matrix b(i,i);
		Matrix c(i,i);
		Matrix d(i,i);
		Matrix e(i,i);

		time(&t1);
		a.QRDecomposition(b,c);
		time(&t2);
		std::cout << difftime(t2,t1) << "\t";

		time(&t1);
		a.Lanczos(d,e);
		time(&t2);
		std::cout << difftime(t2,t1) << "\n";
	}
}